#LEADER STUDY
library(foreign)
pic <- read.dta ("rgraphleaders.dta")
require(sciplot)

#Figure 1b 
par(mfrow=c(1,3), las=1)
bargraph.CI (berlusconi, support, main="Berlusconi", ylim=c(0,0.7), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5, cex.main=2, col="white", err.lty=2, err.width=0.08,  data = pic)
bargraph.CI (renzi, support, main="Renzi", ylim=c(0,0.7), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5, cex.main=2, col="white", err.lty=2, err.width=0.08,  data = pic)
bargraph.CI (vendola, support, main="Vendola", ylim=c(0,0.7), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5, cex.main=2, col="white", err.lty=2, err.width=0.08, data = pic)

  ***
  
#CANDIDATE STUDY
  library(foreign)
pic <- read.dta ("rgraphcandidates.dta")
require(sciplot)

#Figure 1a 
par(mfrow=c(2,4), las=1)
bargraph.CI (couple1, support, main="Left-wing Female", ylim=c(0,0.5), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5, col="white", err.lty=2, err.width=0.08,  data = pic)
bargraph.CI (couple2, support, main="Left-wing Female", ylim=c(0,0.5), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5, col="white", err.lty=2, err.width=0.08,  data = pic)
bargraph.CI (couple3, support, main="Left-wing Male", ylim=c(0,0.5), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5,  col="white", err.lty=2, err.width=0.08, data = pic)
bargraph.CI (couple4, support, main="Left-wing Male", ylim=c(0,0.5), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5,  col="white", err.lty=2, err.width=0.08, data = pic)

bargraph.CI (couple5, support, main="Right-wing Female", ylim=c(0,0.5), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5, col="white", err.lty=2, err.width=0.08, data = pic)
bargraph.CI (couple6, support, main="Right-wing Female", ylim=c(0,0.5), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5, col="white", err.lty=2, err.width=0.08, data = pic)
bargraph.CI (couple7, support, main="Right-wing Male", ylim=c(0,0.5), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5, col="white", err.lty=2, err.width=0.08, data = pic)
bargraph.CI (couple8, support, main="Right-wing Male", ylim=c(0,0.5), ylab="", legend=F, xlab="", x.leg=1, cex.names = 1.5, cex.axis=1.5, col="white", err.lty=2, err.width=0.08, data = pic)